package src.LLVM.control;

import src.LLVM.IR;

public class CallIR implements IR {
    private final String res;
    private String params = "";
    private final String returnType;
    private final String func_name;
    public CallIR(String res, String reType, String func_name){
        this.func_name = func_name;
        this.res = res;
        this.returnType = reType;
    }
    public CallIR(String res, String reType, String func_name, String params){
        this.res = res;
        this.returnType = reType;
        this.params = params;
        this.func_name = func_name;
    }
    @Override
    public String toString(){
        if (returnType.equals("void")){
            return "\t" + "call " +  returnType + " @" + func_name + "(" + params + ")";
        }
        return "\t" + res + " = call " + returnType + " @" + func_name + "(" + params + ")";
    }
}
